package d0320;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
public class Test2 {
    public static void main(String[] args) {
        byte[] b = new byte[1024];
        int a = 0;
        int A = 0;
        try {
            FileInputStream fis = new FileInputStream("src//d0320//calcCharNum.txt");
            int count = fis.read(b);
            while(count != -1) {
                for(int i = 0; i < count; i++) {
                    if(b[i] == 'a') {
                        a++;
                    }
                    if(b[i] == 'A') {
                        A++;
                    }
                }
                count = fis.read(b);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("A:"+A);
        System.out.println("a:"+a);
    }
}